POV-Ray : Newsgroups : povray.advanced-users : Need help creating "flat" quadradural panels with smooth_triangle : Re: Need help creating "flat" quadradural panels with smooth_triangle Server Time
28 Jul 2024 12:28:17 EDT (-0400)
  Re: Need help creating "flat" quadradural panels with smooth_triangle  
From: Mesh Mongrel
Date: 21 Oct 2005 00:20:00
Message: <web.43586b5c748e45a8cfcbd10@news.povray.org>
Thanks Chris.  I found your explaination quite interesting.

What you are suggesting would translate in my case to so:

mesh {
        #local P1 = <x1, y1, z1>;
        #local P2 = <x2, y2, z2>;
        #local P3 = <x3, y3, z3>;
        #local P4 = <x4, y4, z4>;
        #local N1 = vnormalize(vcross(P3 - P1, P2 - P1));
        #local N2 = vnormalize(vcross(P1 - P2, P3 - P2));
        #local N3 = vnormalize(vcross(P1 - P3, P2 - P3));
        #local N4 = vnormalize(vcross(P4 - P3, P2 - P3));
        #local N5 = vnormalize(vcross(P3 - P2, P4 - P2));
        #local N6 = vnormalize(vcross(P3 - P4, P2 - P4));
        #local Na = (N2 + N5) / 2;
        #local Nb = (N3 + N4) / 2;
        smooth_triangle { P1, N1, P2, Na, P3, Nb }
        smooth_triangle { P2, Na, P3, Nb, P4, N6 }
}

I get very strange results when I try this.  I end up with shadows in
strange parts of my panels.  Through trial and error and basically
intepretting what little I read in as many ways as possible, I came up with
a solution I posted about the same time you were typing up your post.

I found that I needed to average all of SP2 and SP3's normals together and
use those for all instances of SP2 and SP3 in the smooth_triangles.  That
worked for my problem and it sort of makes sense to me even though I didn't
find that solution intuitative.

Does the solution in my earlier post look reasonable?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.